<!DOCTYPE html>
<html lang="cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div1 {
            width: 600px;
            height: 400px;
            background-color: aqua;
        }
        
        .div2 {
            display: none;
        }
    </style>
</head>

<body>
    <div class="div1">下午好</div>
    <button type="button" class="btn1">点我上面的div消失</button>
</body>


</html>
<script>
    let div1 = document.querySelector(".div1");
    let btn1 = document.querySelector(".btn1");

    btn1.addEventListener("click", function() {
        div1.className = "div2";
    });
</script>